package com.sanbi.common.express.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 取消出库类型 枚举
 */
@AllArgsConstructor
@Getter
public enum CancelOutBoundEnum {
    AP("AP", "地址问题"),
    RO("RO","重复下单"),
    OS("OS","商品缺货"),
    BC("BC","买家取消"),
    CF("CF", "计费失败"),
    OT("OT","其它原因");
    /** 编码 */
    final String code;
    /** 描述 */
    final String desc;

    public static CancelOutBoundEnum getByCode(String code) {
        for (CancelOutBoundEnum cancelOutBoundEnum : CancelOutBoundEnum.values()) {
            if (cancelOutBoundEnum.getCode().equals(code)) {
                return cancelOutBoundEnum;
            }
        }
       return null;
   }
}
